package com.xmy.cultivate.mapper;

import com.xmy.cultivate.entity.BookText;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 书名 Mapper 接口
 * </p>
 *
 * @author hpiggy
 * @since 2025-03-13
 */
public interface BookTextMapper extends BaseMapper<BookText> {

    @Select("SELECT GROUP_CONCAT( DISTINCT year_class_id ORDER BY year_class_id ) AS yearClassIdStr,GROUP_CONCAT( DISTINCT subjects_id ORDER BY subjects_id ) AS subjectsIdStr FROM book_text_year_class WHERE book_text_id = #{bookTextId}")
    BookText getDistinctDetailsByBookTextId(@Param("bookTextId") Long bookTextId);

}
